/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SMeterInputConverter.java
 * Created：		2016年8月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.notice.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.notice.AReceiver;
import com.thor.palmmall.spi.notice.SReceiver;

/**
 * @author zcb
 *
 */
public class AReceiverConverter implements Converter<SReceiver, AReceiver> {

  public static AReceiverConverter getInstance() {
    if (instance == null)
      instance = new AReceiverConverter();
    return instance;
  }

  private static AReceiverConverter instance;

  private AReceiverConverter() {
  }

  @Override
  public AReceiver convert(SReceiver source) {
    if (source == null)
      return null;

    AReceiver target = new AReceiver();

    target.setUuid(source.getUuid());
    target.setCode(source.getCode());
    target.setName(source.getName());
    target.setType(source.getType());

    return target;
  }

}
